package Entidades;
import java.io.Serializable;
import java.util.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;


@Entity
@Table(name="Factura")
public class Factura implements Serializable{
	private static final long serialVersionUID=1L;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(nullable=false, name="nroFactura")
	private int nroFactura;
	
	
	
	
	@Column(nullable=false, name="fechaApert")
	private Date fechaApert;
	
	@Column(nullable=true, name="fechaCierre")
	private Date fechaCierre;
	
	@Column(nullable=true, name="total")
	private float total;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(nullable=false, name="idComanda")
	private List<Comanda> Comandas;

	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(nullable=false, name="nroCli")
	private Cliente Cliente;
}
